﻿using System;
using System.Diagnostics;
using System.Reflection;
using System.Windows.Forms;

namespace SimpleMediaPlayer
{
    public partial class About : Form
    {
        public About()
        {
            InitializeComponent();
        }

        private void About_Load(object sender, EventArgs e)
        {
            string arch = "";
            string playerVersion = "";

            if (Assembly.GetExecutingAssembly().GetName().ProcessorArchitecture.ToString().ToLower() == "x86")
            {
                arch = " (32bit build)";
            }
            else if (Assembly.GetExecutingAssembly().GetName().ProcessorArchitecture.ToString().ToLower() == "amd64")
            {
                arch = " (64bit build)";
            }

            var playerInfoVersion = Attribute.GetCustomAttributes(typeof(MediaPlayer.Player).Assembly, typeof(AssemblyInformationalVersionAttribute)) as AssemblyInformationalVersionAttribute[];

            if (playerInfoVersion.Length > 0)
            {
                playerVersion = playerInfoVersion[0].InformationalVersion;
            }

            labelApplicationTitle.Text = Application.ProductName;
            labelVersion.Text = Application.ProductVersion + arch;
            labelInternalPlayer.Text = "Internal Player Control " + playerVersion;
        }

        private void buttonClose_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void linkLabelWebsite_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("http://radioactivefrog.com/mediamanager");
        }

        private void linkLabelDsNet_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("http://directshownet.sourceforge.net/");
        }

        private void linkLabelMfNet_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
        {
            Process.Start("http://mfnet.sourceforge.net/");
        }
    }
}
